package com.glasses.primework;


import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
import org.primefaces.event.ToggleEvent;
import org.primefaces.model.Visibility;


@ManagedBean
public class FieldsetBean {
    public void onToggle(ToggleEvent event) {
        System.out.println("FieldsetBean.onToggle(...) was triggered!");
        Visibility visibility = event.getVisibility();
        FacesMessage msg = new FacesMessage();
        msg.setSummary("Fieldset " + event.getPhaseId() + " toggled");
        msg.setDetail("Visibility: " + visibility);
        FacesContext.getCurrentInstance().addMessage(null, msg);
    }
}
